//
//  PhotoItemViewController.h
//  SecretAlbums
//
//  Created by BabyFinancial on 15/6/25.
//  Copyright (c) 2015年 BabyFinancial. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Media.h"
#import <MediaPlayer/MediaPlayer.h>

typedef NS_ENUM(NSInteger, PlayVideoState) {
    PlayVideoStatePlaying = 0,      // 播放中
    PlayVideoStateFinished          // 播放完成
};

@class AssetItemViewController;

@protocol AssetItemViewControllerDataSource <NSObject>

@required
- (Media *)mediaAtIndex:(NSUInteger)index;

@end

@protocol AssetItemViewControllerDelegate <NSObject>

@required
- (void)playVideo:(AssetItemViewController *)assetItemViewController;
- (MPMoviePlayerController *)playerController;
- (void)longPress:(AssetItemViewController *)assetItemViewController;

@end

@interface AssetItemViewController : UIViewController

@property (nonatomic, weak) id<AssetItemViewControllerDataSource> dataSource;
@property (nonatomic, weak) id<AssetItemViewControllerDelegate> delegate;
@property (nonatomic, assign) NSInteger pageIndex;

+ (AssetItemViewController *)assetItemViewControllerForPageIndex:(NSInteger)pageIndex;
- (UIImageView *)imageViewInAssetView;
- (BOOL)isVideo;
- (void)setFullResolutionImage:(UIImage *)image;
- (void)setVideoState:(PlayVideoState)state;

@end
